var httpURL = "http://127.0.0.1:8080";
function httpGet(_url,_callback) {
    $.get({
        url: _url,
        async: false,
        success: function(data){
            _callback(data);
            },
        error: function (error) {
            console.log("连接服务器失败");
        }
    });
}

function httpPost(_url, _data, _callback) {
    $.post({
        url: _url,
        async: false,
        data: JSON.stringify(_data),
        dataType: "json",
        contentType:"application/json",
        success: function(data){
            _callback(data);
        },
        error: function (error) {
            console.log("连接服务器失败");
        }
    });
}

function httpPut(_url, _data, _callback) {
    $.ajax({
        type:'PUT',
        url:_url,
        async:false,
        data:JSON.stringify(_data),
        dataType:'json',
        contentType:"application/json",
        success:function(data){
            _callback(data);
        },
        error:function(error){
            console.log("连接服务器失败");
        }
    });
}
